<template>
  <div class="feedback-page">
    <a-card :bordered="false">
      <!-- 表格顶部搜索部分 -->
      <c-table-search-form
        v-model="tableSearchForm"
        :datas="tableSearchFormData"
        @onSearch="handleSearch"
        @onExport="handleExport"
      >
      </c-table-search-form>

      <!-- 表格部分 -->
      <c-table
        showPagination
        :columns="tableColumns"
        :datas="tableData"
        :loading="loading"
        :paginationDatas="paginationDatas"
        @onPageSizeChange="onPageSizeChange"
        @onShowNumChange="onShowNumChange"
      >
      </c-table>
    </a-card>
  </div>
</template>

<script>
import { mapState } from "vuex";
import { getUserList } from "@/api/company/users";

export default {
  name: "Feedback",
  components: {},
  data() {
    return {
      tableSearchForm: {
        searchKey: ""
      },
      tableSearchFormData: [
        {
          label: "请输入用户名称/手机号码",
          prop: "searchKey",
          type: "search"
        },
        {
          prop: "exportBtn",
          type: "exportBtn"
        }
      ],
      tableColumns: [
        {
          title: "用户姓名",
          dataIndex: "",
          align: "center"
        },
        {
          title: "手机号码",
          dataIndex: "",
          align: "center"
        },
        {
          title: "类型",
          dataIndex: "",
          align: "center"
        },
        {
          title: "反馈时间",
          dataIndex: "userId",
          align: "center"
        },
        {
          title: "备注",
          dataIndex: "",
          align: "center"
        }
      ],
      tableData: [],
      paginationDatas: {
        pageSizeOptions: ["10", "20", "30", "40", "50","200","1000"],
        pageSize: 10,
        pageNum: 1,
        total: 0
      }
    };
  },
  computed: {
    ...mapState({})
  },
  created() {
    this.onPageOnlod();
  },
  mounted() {},
  methods: {
    handleSearch() {
    },
    handleExport() {
    },
    onPageOnlod() {
      this.loading = true;
      getUserList({
        auditState: this.companyStatus ? Number(this.companyStatus) : "",
        pageData: {
          ...{
            pageSize: this.paginationDatas.pageSize,
            pageNum: this.paginationDatas.pageNum
          }
        }
      })
        .then(res => {
          this.tableData = res.data.pageData;
          this.paginationDatas.total = res.data.total;
          this.loading = false;
        })
        .finally(() => {
          this.loading = false;
        });
    },
    onShowNumChange(val) {
      this.paginationDatas.pageNum = val;
      this.onPageOnlod();
    },
    onPageSizeChange(val) {
      this.paginationDatas.pageSize = val;
      this.onPageOnlod();
    }
  }
};
</script>

<style lang="less" scoped>
</style>



